;;;Prints a proverb to the output (text) screen and command line.
;;;Requires proverbs.dat
;;;
;;;	Author:
;;;		Henry C. Francis
;;;		425 N. Ashe St.
;;;		Southern Pines, NC 28387
;;;
;;;	http://www.paracadd.com
;;;	All rights reserved.
;;;
(defun c:prov ()
  (setq locfile (findfile "proverbs.dat"))
  (if locfile
    (progn
      (setq datfile (open locfile "r"))
      (setq count 0)
      (setq locptr (findfile "proverbs.ndx"))
      (if locptr
        (progn
          (setq ptrfile (open locptr "r"))
          (setq pointer (atoi(read-line ptrfile)))
          (close ptrfile)
          (setq ptrfile (open locptr "w"))
          (write-line (itoa(1+ pointer)) ptrfile)
          (close ptrfile)
        )
        (progn
          (setq pointer 1)
          (setq ptrfile (open "u:/proverbs.ndx" "w"))
          (write-line (itoa pointer) ptrfile)
          (close ptrfile)
        )
      )
      (while (/= count pointer)
        (setq cur_prov (read-line datfile))
        (setq count (1+ count))
      )
      (close datfile)
      (princ cur_prov)
    )
    (princ "\nPROVERBS.DAT not found! ")
  )
  (princ)
)